home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / ax3.00 / logs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-03  |  991 b   |  51 lines

  1. #include "bbs.h"
  2.  
  3. void CallersLog(char *stringout)
  4. {
  5.  char buff[100];
  6.  FILE *GFP1;
  7.  //if(!(GET_BIT(ACS_DO_CALLERSLOG)))    return;
  8.  
  9.  sprintf(buff,"%sNode%u/CallersLog",Cmds->BBSLoc,Cmds->AcLvl[LVL_NODE_NUMBER]);
  10.  
  11.  GFP1=fopen(buff,"r");
  12.  if(GFP1==NULL)    GFP1=fopen(buff,"w");
  13.  else {
  14.         fclose(GFP1);
  15.         GFP1=fopen(buff,"a");
  16.     }
  17.  
  18.  if(GFP1) {
  19.         fprintf(GFP1,"%s",stringout);
  20.         fclose(GFP1);
  21.     }
  22. }
  23. void DebugLog(int data)
  24. {
  25.  char buff[40];
  26.  sprintf(buff,"\tD-(Node %d)%d\n",Cmds->AcLvl[LVL_NODE_NUMBER],data);
  27.  ErrorLog(buff);
  28. }
  29.  
  30. void ErrorLog(char *stringout)
  31. {
  32.  FILE *GFP1;
  33. UBYTE XGSTR1[20], XGSTR2[20];
  34.  
  35.  char fname[100];
  36.  
  37.      Time_system=time(NL);
  38.      strcpy(XGSTR1,GetTheDate(Time_system));
  39.      strcpy(XGSTR2,GetTheTime(Time_system));
  40.  
  41.      sprintf(fname,"%sNode%u/ErrorLog",Cmds->BBSLoc,Cmds->AcLvl[LVL_NODE_NUMBER]);
  42.  
  43.      /* date, time */
  44.  
  45.      GFP1=fopen(fname,"a");
  46.      if(GFP1) {
  47.             fprintf(GFP1,"%s (%s) %s",XGSTR1,XGSTR2,stringout);
  48.             fclose(GFP1);
  49.         }
  50. }
  51.